<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use \DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class MysqlController extends Controller
{
    public function getIndex(){
    	// $data=DB::select('select * from user where id>? and id<?',array(1,3));
    	// dd($data);
    	// return view('view.index',[
    	// 	'list'=>$data
    	// 	]);

    	// $data=DB::insert('insert into user values(null,"admin4","0","23","lamp169")');
    	// $data=DB::insert('insert into user values(null,?,?,?,?)',array('admin5',1,23,'lamp169'));

    	// $data=DB::update('update user set name="admin0" where id>? and id<?',array(2,5));

    	// $data=DB::delete('delete from user where id=?',[7]);
    	// DB::beginTransaction();
    	// DB::delete('delete from user where id=?',[1]);
    	// DB::rollBack();
    	// DB::commit();

    	// $data=DB::table('user')->insert([
    	// 	'age'=>21,'sex'=>0,'classid'=>'lamp169'
    	// 	]);

    	// $data= DB::table('user')->insert([
    	// 	['name'=>'zjl','age'=>21,'sex'=>1,'classid'=>'lamp169'],
    	// 	['name'=>'zjl1','age'=>21,'sex'=>1,'classid'=>'lamp169'],
    	// 	['name'=>'zjl2','age'=>21,'sex'=>1,'classid'=>'lamp169']
    	// 	]);

    	// $data = DB::table('user')->insertGetId(
    	// 	['name'=>'zou','age'=>21,'sex'=>1,'classid'=>'lamp169']
    	// 	);

    	// $data=DB::table('user')->where('id',5)->update(['name'=>456]);

    	// $data=DB::table('user')->where('name','zou')->delete();

    	// $data=DB::table('user')->get();
    	// $data=DB::table('user')->first();
    	// $data=DB::table('user')->value('name');//一条数据
    	// $data=DB::table('user')->lists('name');
    	// $data=DB::table('user')->select('name','classid as bj')->get();
    	// $data=DB::table('user')->where('name','like','%z')->get();

    	// $data=DB::table('user')->where('id',6)->orWhere('id',9)->get();

    	// $data=DB::table('user')->where('id','>',3)->where('id','<',10)->get();

    	// $data=DB::table('user')->whereBetween('id',[6,12])->get();

    	// $data=DB::table('user')->whereIn('id',[1,2,3])->get();

    	// $data=DB::table('user')->orderBy('id','desc')->get();

    	// $data=DB::table('user')->skip(1)->take(5)->get();
    	// $data=DB::table('user')->join('hobby','user.id','=','hobby.uid')->select('user.*','hobby.hobby')->get();

    	// $data=DB::table('user')->count();
    	// $data=DB::table('user')->max('age');
    	// $data=DB::table('user')->avg('age');

    	fun();

    	// var_dump($data);

    	// dd($data);




















    }
}
